package com.chance.cc.crawler.prod.command.trigger.domain.news.hupu;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.hupu.module.HupuModuleKeywordRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.hupu.module.HupuModuleKeywordTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.hupu.module.HupuModuleKeywordTraceTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.hupu.searchKw.HupuRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.hupu.searchKw.HupuTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-09 16:15:28
 * @email okprog@sina.com
 */
public class HupuCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {
    public static void main(String[] args) {
//        publishHupuSearchKwRealtimeCrawlerScheduleTriggerInfo();
//        publishHupuSearchKwTraceCrawlerScheduleTriggerInfo();

        publishHupuModuleKeywordRealtimeCrawlerScheduleTriggerInfo();
//        publishHupuModuleKeywordTraceCrawlerScheduleTriggerInfo();
        publishHupuModuleKeywordTraceTraceCrawlerScheduleTriggerInfo();
    }

    public static void publishHupuSearchKwRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = HupuRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                HupuRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "虎扑论坛实时采集任务执行，每十分钟执行一次"
        );
    }

    public static void publishHupuSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = HupuTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                HupuTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "虎扑回溯采集任务执行，每一个小时执行一次"
        );
    }

    public static void publishHupuModuleKeywordRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = HupuModuleKeywordRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                HupuModuleKeywordRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/30 * * * ?",
                "虎扑模块以关键词形式实时采集任务执行，每30分钟执行一次"
        );
    }

    public static void publishHupuModuleKeywordTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = HupuModuleKeywordTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                HupuModuleKeywordTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/2 * * ?",
                "虎扑模块以关键词形式实时采集任务执行，每小时执行一次"
        );
    }

    public static void publishHupuModuleKeywordTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = HupuModuleKeywordTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                HupuModuleKeywordTraceTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "虎扑模块以关键词形式回溯7天采集任务执行，每天一点定时执行"
        );
    }
}
